// axiosConfig.js
import axios from 'axios';

const axiosInstance = axios.create();

axiosInstance.interceptors.response.use(
  response => response,
  error => {
    if (error.response.status === 401) {
      // Token expired or user not authorized, redirect to login page

      window.location.href = '#/login'
      window.location.reload();
    }
    return Promise.reject(error);
  }
);

export default axiosInstance;
